﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;

/// <summary>
/// Summary description for renewBLL
/// </summary>
public class RenewBLL
{
    RenewDAL dal = new RenewDAL();
    AccountsManager am = new AccountsManager();

	public RenewBLL()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public void renew(String custId,int currentInsuredID, String savingAccountNo)
    {
        dal.renew(currentInsuredID);

        Hashtable insured = am.getInsuranceInfo(currentInsuredID);
        String insurance_acc = insured["accountNo"] as String;
        Decimal amount = (Decimal)insured["Premium"];

        am.transfer(savingAccountNo, insurance_acc, amount,"INSURANCE PAYMENT");

        Alert alert = new Alert();
        alert.addAlertApplication(custId, "Your INSURANCE policy has been renewed.", "../product/insurance/user/insurance_statement.aspx");

    }

   
}